In our implementation vertices are represented by Airport objects and  edges are represented by Flight objects.
\begin{lstlisting}[caption=Initialization step, label={lst:myListing}]
public List<Airport> RunDijkstra(Airport source, Airport target, 
string wClause, int deviationDays)
{
try
{
	DBFlight flightDB = new DBFlight();
	List<Flight> edgeObjList = flightDB.GetAllFlights(true);

//List<Flight> edgeObjList = flightDB.GetCriteriaFlights(wClause, true);

	
	DBAirport airportDB = new DBAirport();
	List<Airport> verticeObjList = airportDB.GetAllAirports();

	List<Airport> dijkstraSolutionList = new List<Airport>();
	Airport u = source;	
	
	// Initialization.	
	foreach (Airport v in verticeObjList)
	{
		if (v.IdAirport == u.IdAirport)
		{
			v.Dist = 0; // Source airport
		}
		else
		{
			//set every other airportdistance in the list to infinity.
			v.Dist = int.MaxValue;
			v.PreviousVertex = null;
		}

	v.AdjFlight = new Flight();
	v.Price = 0.0;
	}
\end{lstlisting}
In the initialization step above all flights and airport are retrieved from the database and saved in lists named "edgeObjList" and "verticeObjList". 
The is done through the method GetAllFlights(true) which gets and creates objects for all flights in the database and adds the associated Airplane, StartAirport and DestinationAirport objects to the given flight object. At line 22 the foreach loop takes care of assigning the source Airport's Dist property to 0 and all other Airports' Dist and PreviousVertex property to infinity and undefined. 

\begin{lstlisting}[caption=While loop, label={lst:myListing}]
while (verticeObjList.Count > 0)
{
	u = SmallestDistInQ(verticeObjList);
	verticeObjList.Remove(u);					
	dijkstraSolutionList.Add(u);

	if (u.Dist == int.MaxValue)
	{
		break;
	}

	List<Flight> adjFlightList = AdjFlights(edgeObjList, u);
\end{lstlisting}
The while loop checks that verticeObjList is not empty.
u, the source in the first iteration, is assigned to the airport with the smallest Dist value from the queue through the method SmallestDistInQ(verticeObjList). It is then removed from the list and added to the solution list. \\
An if condition is done to make sure that the distance of u does not equal infinity and a new list of Flight objects "adjFlightList" is assigned to the method AdjFlights(edgeObjList, u), which returns the adjacent Flight objects to the given u. \\
The code for the methods can be found in the appendix, SmallestDistInQ(verticeObjList) at listing  ~\ref{lst:SmallestDistInQ}  and AdjFlights(edgeObjList, u) at listing ~\ref{lst:AdjFlights}.

\begin{lstlisting}[caption=Relaxation step, label={lst:myListing}]
	int alt;
	// for each neighbor v of u
	for (int i = 0; i < adjFlightList.Count - 1; i++) 
	{
		for (int j = 0; j < verticeObjList.Count; ++j)
		{
		if (verticeObjList[j].IdAirport == adjFlightList[i].DestinationAirport.IdAirport)
		{
			alt = u.Dist + adjFlightList[i].Traveltime;
			if (alt < verticeObjList[j].Dist)
			{
			verticeObjList[j].Dist = alt;
			verticeObjList[j].PreviousVertex = u;
			verticeObjList[j].AdjFlight = adjFlightList[i];
			verticeObjList[j].Price = adjFlightList[i].Price;
		}
		
		//Optimization with several shortest paths of same length
		//else if (alt == verticeObjList[j].Dist)
		//{
		//    verticeObjList[j].Dist = alt;
		//    verticeObjList[j].PreviousVertex = u;
		//    verticeObjList[j].FlightList.Clear();
		//    verticeObjList[j].FlightList.Add(adjFlightList[i]);
		//}
		}
		}
		}
	} // end while loop
dijkstraSolutionList = BacktrackDijkstra(dijkstraSolutionList, target);
return dijkstraSolutionList;
}
catch (Exception ex)
{
	throw new Exception(ex.Message);
}
}
\end{lstlisting}
The code above describes the relaxation step in Dijkstra's where for each adjacent v of u; the vertex's Dist and Previous is updated if a better path is found. The adjacent flight that lead to the adjacent vertex is saved in the AdjFlight property and the price of the given flight saved on the vertex.

\begin{lstlisting}[caption=Backtrack Dijkstra, label={lst:myListing}]
private List<Airport> BacktrackDijkstra(List<Airport> verticeObjList, 
Airport target)
{
	List<Airport> solutionList = new List<Airport>();
	//loop through the list to find the actual target with this id 
	//on the solution list, if found, replace.
	foreach (Airport airportobj in verticeObjList)
	{
		if (airportobj.IdAirport == target.IdAirport)
		{
	//replace -to be able to use target in dijkstra solution list. 
	//stop after the target element is found
		target = airportobj;
		break;
		}
	}
	//set current target with the one we found in dijkstra list
	Airport u = target;
	double price = 0.0;
	int totaltraveltime = 0;
	Flight startflight = new Flight();

	// While there is a parent to this Airport
	while (u.PreviousVertex != null)
	{
		solutionList.Add(u);  // Add Airport to solution

		// Summing up traveltime
		totaltraveltime += u.Dist;
		u.Dist = totaltraveltime;

		// Summing up price
		price += u.Price;
		u.Price = price;
		
		startflight = u.AdjFlight;

		u = u.PreviousVertex; // Add parent Airport as new Target 
	}

	//to prevent adding target to the list when the list is empty
	if (solutionList.Count > 0)
	{
		u.Dist = totaltraveltime;
		u.Price = price;
		u.AdjFlight = startflight;
		solutionList.Add(u);
	}

	return solutionList;
}
\end{lstlisting}
The Backtrack method loops through the provided list from Dijkstra's and saves the target in an Airport object called "target". It then starts backtracking through the list, using the PreviousVertex property, while adding each Airport to a solution list. It stops when it find an Airport where PreviousVertex = null and it sums up travel time and price along the way. Last it makes sure that it doesn't add the target to the list in case the list is empty and returns the list.